import api.ByeService;
import api.HelloObject;
import api.HelloService;
import rpc.transport.RpcClientProxy;
import rpc.serializer.KryoSerializer;
import rpc.transport.socket.client.SocketClient;

/**
 * 测试用消费者（客户端
 *
 * @Author wupeijie
 * @Date 2020/11/19 19:50
 */
public class SocketTestClient {
    public static void main(String[] args) {
        SocketClient client = new SocketClient();
        client.setSerializer(new KryoSerializer());
        RpcClientProxy proxy = new RpcClientProxy(client);
        HelloService helloService = proxy.getProxy(HelloService.class);
        HelloObject object = new HelloObject(12, "This is a message");
        String res = helloService.hello(object);
        System.out.println(res);
        ByeService byeService = proxy.getProxy(ByeService.class);
        System.out.println(byeService.bye("Netty"));

    }
}
